package com.azusa.xbiao.dao;

import com.azusa.xbiao.entity.Goods;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface GoodsMapper {

    @Select("SELECT " +
            " goods.id,  " +
            " goods.title,  " +
            " goods.intro,  " +
            " goods.type,  " +
            " goods.price,  " +
            " goods.count,  " +
            " goods.look,  " +
            " goods.publish_time AS publishTime,  " +
            " goods.commodit_url AS commoditUrl,  " +
            " goods.shop_name AS shopName,  " +
            " goods.release_date AS releaseDate,  " +
            " goods.sales " +
            "FROM " +
            " goods " +
            "WHERE goods.title LIKE CONCAT('%',#{title},'%')" +
            "ORDER BY " +
            " goods.sales DESC")
    List<Goods> selectAll(String title);
}
